import type { commandList } from './run'
import { cac } from 'cac'
import { consola } from 'consola'
import { run } from './run'

try {
  const turboRun = cac('turbo-run')
  turboRun
    .command('[script]')
    .usage(`Run turbo interactively.`)
    .action(async (command: (typeof commandList)[number]) => {
      run(command)
    })

  turboRun.usage('turbo-run')
  turboRun.help()
  turboRun.parse()
}
catch (error) {
  consola.error(error)
}
